import request from '@/utils/request'
import type { AttrInfoModel } from '@/api/product/model/attr'

enum Api {
  // 获取属性列表api
  getAttrInfoListApi = '/admin/product/attrInfoList',
  // 删除属性api
  deleteAttrInfo = '/admin/product/deleteAttr',
  //添加属性值api
  addAttrValue = '/admin/product/saveAttrInfo',
}

// 获取属性列表请求
export const reqGetAttrInfoListData = (
  category1Id: number,
  category2Id: number,
  category3Id: number
) => {
  return request.get(
    `${Api.getAttrInfoListApi}/${category1Id}/${category2Id}/${category3Id}`
  )
}

//删除属性列表请求
export const reqDelOneAttrInfo = (attrId: number) => {
  return request.delete<any,null>(`${Api.deleteAttrInfo}/${attrId}`)
}

//添加属性值请求
export const reqAddAttrValue = (attrInfo:AttrInfoModel) => {
  return request.post<any, null>(`${Api.addAttrValue}`, attrInfo)
}
